<?php
//用于扩展插件的url输出
$extendAppUrlArray = $this->frontwebsite()->frontExtendUrlArray();
$extendAppUrlPath  = $this->url('shopfront/default');
?>
<div class="sidebar fl" style="width:240px;">
  <h2 class="header"><?php echo $this->translate('会员中心'); ?></h2>
  <div class="box">
    <h2><?php echo $this->translate('中心服务'); ?></h2>
    <ul class="menu-list">
      <li>
        <a href="<?php echo $this->url('fronthome/default'); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Home' and $this->myviewalias()->returnActionname() == 'index') echo 'class="current"'; ?>><?php echo $this->translate('中心首页'); ?></a>
      </li>
    </ul>
    <h2><?php echo $this->translate('交易管理'); ?></h2>
    <ul class="menu-list">
      <li>
        <a href="<?php echo $this->url('frontorder/default'); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Order' and $this->myviewalias()->returnActionname() != 'virtualGoods') echo 'class="current"'; ?>><?php echo $this->translate('我的订单'); ?></a>
      </li>
      <li>
        <a href="<?php echo $this->url('frontorder/default', array('action'=>'virtualGoods')); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Order' and $this->myviewalias()->returnActionname() == 'virtualGoods') echo 'class="current"'; ?>><?php echo $this->translate('虚拟商品'); ?></a>
      </li>
      <?php
      $refundState  = $this->frontwebsite()->getOrderConfig('user_order_refund');
      if($refundState == 'true') {
      ?>
      <li>
        <a href="<?php echo $this->url('frontrefund/default'); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Homerefund') echo 'class="current"'; ?>><?php echo $this->translate('退货申请'); ?></a>
      </li>
      <?php } ?>
      <li>
        <a href="<?php echo $this->url('frontfavorites/default'); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Homefavorites') echo 'class="current"'; ?>><?php echo $this->translate('我的收藏'); ?></a>
      </li>
      <li>
        <a href="<?php echo $this->url('frontcoupon/default'); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Homecoupon') echo 'class="current"'; ?>><?php echo $this->translate('我的优惠券'); ?></a>
      </li>
      <li>
        <a href="<?php echo $this->url('fronthome/default', array('action'=>'goodsask')); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Home' and $this->myviewalias()->returnActionname() == 'current') echo 'class="active"'; ?>><?php echo $this->translate('我的咨询'); ?></a>
      </li>
        <?php
        //位于订单管理的扩展插件
        if(isset($extendAppUrlArray['userHome']) and !empty($extendAppUrlArray['userHome'])) {
            foreach($extendAppUrlArray['userHome'] as $homeKey => $homeUrlValue) { ?>
                <li <?php if($this->myviewalias()->returnNamespace() == ucfirst($homeKey).'\Controller') echo 'class="active"'; ?>><a href="<?php echo $extendAppUrlPath . $homeUrlValue['url']; ?>"><?php echo $homeUrlValue['name']; ?></a></li>
            <?php } } ?>
    </ul>
    <h2><?php echo $this->translate('账户管理'); ?></h2>
    <ul class="menu-list">
      <li>
        <a href="<?php echo $this->url('fronthome/default', array('action'=>'useredit')); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Home' and $this->myviewalias()->returnActionname()=='useredit') echo 'class="current"'; ?>><?php echo $this->translate('个人资料'); ?></a>
      </li>
      <li>
        <a href="<?php echo $this->url('frontmoney/default'); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Homemoney') echo 'class="current"'; ?>><?php echo $this->translate('账户余额'); ?></a>
      </li>
      <li>
        <a href="<?php echo $this->url('fronthome/default', array('action'=>'userpasswd')); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Home' and $this->myviewalias()->returnActionname()=='userpasswd') echo 'class="current"'; ?>><?php echo $this->translate('密码修改'); ?></a>
      </li>
      <?php if ($this->frontwebsite()->getUserIni('qq_login_state') == 'true') { ?>
      <li>
        <a href="<?php echo $this->url('fronthome/default', array('action'=>'qqset')); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Home' and $this->myviewalias()->returnActionname()=='qqset') echo 'class="current"'; ?>><?php echo $this->translate('QQ绑定'); ?></a>
      </li>
      <?php } ?>
      <?php if ($this->frontwebsite()->getUserIni('weixin_login_state') == 'true') { ?>
        <li>
          <a href="<?php echo $this->url('fronthome/default', array('action'=>'weixinset')); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Home' and $this->myviewalias()->returnActionname()=='weixinset') echo 'class="current"'; ?>><?php echo $this->translate('微信绑定'); ?></a>
        </li>
      <?php } ?>
      <?php if ($this->frontwebsite()->getUserIni('alipay_login_state') == 'true') { ?>
        <li>
          <a href="<?php echo $this->url('fronthome/default', array('action'=>'alipayset')); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Home' and $this->myviewalias()->returnActionname()=='alipayset') echo 'class="current"'; ?>><?php echo $this->translate('支付宝绑定'); ?></a>
        </li>
      <?php } ?>
      <li>
        <a href="<?php echo $this->url('frontaddress/default'); ?>" <?php if($this->myviewalias()->returnControllername() == 'Shopfront\Controller\Homeaddress') echo 'class="current"'; ?>><?php echo $this->translate('收货地址'); ?></a>
      </li>
      <li>
        <a href="<?php echo $this->url('frontuser/default',array('action'=>'loginout')); ?>"><?php echo $this->translate('用户退出'); ?></a>
      </li>
    </ul>
  </div>
</div>